//
//  KDCalendarControl.h
//  KDCalendarControl
//
//  Created by Keith Duncan on 12/08/2007.
//  Copyright 2007 thirty-three. All rights reserved.
//

#import <Cocoa/Cocoa.h>

extern NSString *const KDContentDatesBinding;
extern NSString *const KDDateHighlightedBinding;

@interface KDCalendarControl : NSControl {
	NSCell *_weekCell;
	
	NSMutableDictionary *_bindingInfo;
	
	id target;
	SEL doubleAction;
	
	id _lastClickedDate;
	
	NSButton *_directionButtons[2];
	
	struct {
		NSRange monthRanges[3];
		NSUInteger firstWeekday, lastWeekday;
	} calendarInfo;
	
	NSUInteger _selectedDay;
	NSMutableIndexSet *_highlightedDays;
	
	NSDateComponents *_edgeDateComponents[2];
}

@property(assign) NSDate *selectedDate;
@property(assign) NSDate *currentMonth; // This sets the selected date too

- (void)setBoundaryDate:(NSDate *)date forEdge:(NSRectEdge)edge; // Valid values are NSMinYEdge and NSMaxYEdge for min and max months respectively

@property(assign) SEL doubleAction; // This is sent to the control target

@end

@interface KDCalendarControl (KDKeyValueBinding) <AFKeyValueBinding>

@end
